package org.qydjk.common.pojo;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by Administrator on 2017/12/20 0020.
 */
@Entity
@Table(name = "qy_article", schema = "qydjk", catalog = "")
public class Article {
    private Integer id;
    private String title;
    private String writer;
    private String source;
    private String img;
    private String thumbnailImg;
    private Integer catagoryOneId;
    private String catagoryOne;
    private Integer catagoryTwoId;
    private String catagoryTwo;
    private Integer openNum;
    private String intro;
    private String content;
    private Integer status;
    private Date createTime;
    private Date updateTime;
    private Integer ord;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "title")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "writer")
    public String getWriter() {
        return writer;
    }

    public void setWriter(String writer) {
        this.writer = writer;
    }

    @Basic
    @Column(name = "source")
    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    @Basic
    @Column(name = "img")
    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    @Basic
    @Column(name = "thumbnail_img")
    public String getThumbnailImg() {
        return thumbnailImg;
    }

    public void setThumbnailImg(String thumbnailImg) {
        this.thumbnailImg = thumbnailImg;
    }

    @Basic
    @Column(name = "catagory_one_id")
    public Integer getCatagoryOneId() {
        return catagoryOneId;
    }

    public void setCatagoryOneId(Integer catagoryOneId) {
        this.catagoryOneId = catagoryOneId;
    }

    @Basic
    @Column(name = "catagory_one")
    public String getCatagoryOne() {
        return catagoryOne;
    }

    public void setCatagoryOne(String catagoryOne) {
        this.catagoryOne = catagoryOne;
    }

    @Basic
    @Column(name = "catagory_two_id")
    public Integer getCatagoryTwoId() {
        return catagoryTwoId;
    }

    public void setCatagoryTwoId(Integer catagoryTwoId) {
        this.catagoryTwoId = catagoryTwoId;
    }

    @Basic
    @Column(name = "catagory_two")
    public String getCatagoryTwo() {
        return catagoryTwo;
    }

    public void setCatagoryTwo(String catagoryTwo) {
        this.catagoryTwo = catagoryTwo;
    }

    @Basic
    @Column(name = "open_num")
    public Integer getOpenNum() {
        return openNum;
    }

    public void setOpenNum(Integer openNum) {
        this.openNum = openNum;
    }

    @Basic
    @Column(name = "intro")
    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Basic
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "update_time")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "ord")
    public Integer getOrd() {
        return ord;
    }

    public void setOrd(Integer ord) {
        this.ord = ord;
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;

        Article article = (Article) object;

        if (id != article.id) return false;
        if (title != null ? !title.equals(article.title) : article.title != null) return false;
        if (writer != null ? !writer.equals(article.writer) : article.writer != null) return false;
        if (source != null ? !source.equals(article.source) : article.source != null) return false;
        if (img != null ? !img.equals(article.img) : article.img != null) return false;
        if (thumbnailImg != null ? !thumbnailImg.equals(article.thumbnailImg) : article.thumbnailImg != null)
            return false;
        if (catagoryOneId != null ? !catagoryOneId.equals(article.catagoryOneId) : article.catagoryOneId != null)
            return false;
        if (catagoryOne != null ? !catagoryOne.equals(article.catagoryOne) : article.catagoryOne != null) return false;
        if (catagoryTwoId != null ? !catagoryTwoId.equals(article.catagoryTwoId) : article.catagoryTwoId != null)
            return false;
        if (catagoryTwo != null ? !catagoryTwo.equals(article.catagoryTwo) : article.catagoryTwo != null) return false;
        if (openNum != null ? !openNum.equals(article.openNum) : article.openNum != null) return false;
        if (intro != null ? !intro.equals(article.intro) : article.intro != null) return false;
        if (content != null ? !content.equals(article.content) : article.content != null) return false;
        if (status != null ? !status.equals(article.status) : article.status != null) return false;
        if (createTime != null ? !createTime.equals(article.createTime) : article.createTime != null) return false;
        if (updateTime != null ? !updateTime.equals(article.updateTime) : article.updateTime != null) return false;
        if (ord != null ? !ord.equals(article.ord) : article.ord != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (title != null ? title.hashCode() : 0);
        result = 31 * result + (writer != null ? writer.hashCode() : 0);
        result = 31 * result + (source != null ? source.hashCode() : 0);
        result = 31 * result + (img != null ? img.hashCode() : 0);
        result = 31 * result + (thumbnailImg != null ? thumbnailImg.hashCode() : 0);
        result = 31 * result + (catagoryOneId != null ? catagoryOneId.hashCode() : 0);
        result = 31 * result + (catagoryOne != null ? catagoryOne.hashCode() : 0);
        result = 31 * result + (catagoryTwoId != null ? catagoryTwoId.hashCode() : 0);
        result = 31 * result + (catagoryTwo != null ? catagoryTwo.hashCode() : 0);
        result = 31 * result + (openNum != null ? openNum.hashCode() : 0);
        result = 31 * result + (intro != null ? intro.hashCode() : 0);
        result = 31 * result + (content != null ? content.hashCode() : 0);
        result = 31 * result + (status != null ? status.hashCode() : 0);
        result = 31 * result + (createTime != null ? createTime.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (ord != null ? ord.hashCode() : 0);
        return result;
    }
}
